home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / windownt / ibmsyn.zip / SEMFISIS.H < prev    next >
Text File  |  1992-06-12  |  5KB  |  78 lines

  1.  
  2. /* semfddis.h */
  3.  
  4. /*****************************************************************************/
  5. /* NT IBM SDLC Adapter Device Driver: IBM SDLC adapter-specific stuff        */
  6. /*                                                                           */
  7. /* Note that this also includes codes for the 8255 registers.  The reason    */
  8. /* for this is that the designation of these bits and the use of the 8255    */
  9. /* is really defined by the SDLC adapter.  This is in contrast to the 8273:  */
  10. /* this has its own definition file because the command codes etc. really    */
  11. /* are a property of the 8273 chip and not of the SDLC adapter.              */
  12. /*****************************************************************************/
  13.  
  14. /*****************************************************************************/
  15. /* AR_ : offsets to Adapter Registers                                        */
  16. /*****************************************************************************/
  17.  
  18. #define AR_Max    0x0F   /* Max port in the IO Port range                    */
  19.  
  20. #define AR_8255A  0x00   /* 8255 register A                                  */
  21. #define AR_8255B  0x01   /* 8255 register B                                  */
  22. #define AR_8255C  0x02   /* 8255 register C                                  */
  23. #define AR_8255   0x03   /* 8255 mode set                                    */
  24.  
  25. #define AR_8273S  0x08   /* 8273 Command/Status register                     */
  26. #define AR_8273P  0x09   /* 8273 Parameter/Result register                   */
  27. #define AR_8273T  0x0A   /* 8273 TX result                                   */
  28. #define AR_8273R  0x0B   /* 8273 RX result                                   */
  29. #define AR_8273D  0x0C   /* 8273 Data Buffer                                 */
  30.  
  31. #define AC_MPCAD  0x0F   /* MPCA command: disable                            */
  32.  
  33. /*****************************************************************************/
  34. /* Equates for port values on the 8255                                       */
  35. /*****************************************************************************/
  36.  
  37. #define A55_ModeSet         0x98
  38. #define A55_Reset8273On     0x17
  39. #define A55_Reset8273Off    0x07
  40. #define A55_InitPortC       0xf2
  41. #define A55_ResetPortC      0xfc
  42. #define A55_ResetModemStatusCh       0x08
  43.  
  44. /*****************************************************************************/
  45. /* This is the value in the MCA POS ID register defining an MPA/A adapter.   */
  46. /*****************************************************************************/
  47. #define POS_MPAATypeID       0xdeff
  48.  
  49. /*****************************************************************************/
  50. /* Macro to wait for particular state of 8273                                */
  51. /*****************************************************************************/
  52. #define CVHMAXWT  64            /* Max times to poll 8273 before error       */
  53.  
  54. #define WAITUNTIL(pDX,Mask,OP,StopVal)                                        \
  55. {                                                                             \
  56.   register int waitcnt = CVHMAXWT;                                            \
  57.                                                                               \
  58.   while (waitcnt--)                                                           \
  59.   {                                                                           \
  60.     LastWaitUntilStatus = IO_IN (pDX->ADAPTERBASE + AR_8273S);                \
  61.     if ((LastWaitUntilStatus & (Mask)) OP (StopVal))                          \
  62.       break;                                                                  \
  63.     if (waitcnt <= 1)                                                         \
  64.     {                                                                         \
  65.       pDX->pIR->StatusArray[SA_HardwareError]++;                              \
  66.       pDX->pIR->StatusCount++;                                                \
  67.       pDX->DPCAction |= DPC_ACTION_PULSE;                                     \
  68.       pDX->HardwareError = TRUE; /* can be tested by callers if nec. */       \
  69.       TRACE_EVENT (WaTo);                                                     \
  70.       ASSERT (FALSE);                                                         \
  71.       break;                                                                  \
  72.     }                                                                         \
  73.     KeStallExecutionProcessor (1L);                                           \
  74.   }                                                                           \
  75. }
  76.  
  77.  
  78.